<?php
namespace App\Controller;
use Think\Controller;
class PhotoController extends Controller {
    public function index(){

    }
    public function photojson(){
    	//周艳军做的显示发布评论
        $photo=M('photo');
        $allphoto=$photo->select();
       // var_dump($photo);
        echo json_encode($allphoto);
    	
    }

    public function addphotojson($uid){
       //周艳军写的发布晒图
      $photo=M('photo');
      $uid =$_GET['uid'];
      $content =$_GET['content'];
      $photo1 =$_GET['photo1'];
      $photo2 =$_GET['photo2'];
      $photo3 =$_GET['photo3'];
      $photo4 =$_GET['photo4'];
      $photo5 =$_GET['photo5'];
      $photo6 =$_GET['photo6'];
      $photo7 =$_GET['photo7'];
      $photo8 =$_GET['photo8'];
      $photo9 =$_GET['photo9'];  
      if($photo->where("uid='$uid' and content='$content' and photo1='$photo1' and photo2='$photo2'and photo3='$photo3'and photo4='$photo4'and photo5='$photo5'and photo6='$photo6'and photo7='$photo7'and photo8='$photo8'and photo9='$photo9'"))
      	{
            echo "{'info':true}";
        }else{
            echo "{'info':false}";
        }
}

    public function delphotojson($pid){
    	//周艳军写的删除晒图
        $photo=M('photo');

         if (false !== $photo->where("pid=$pid")->delete()) {
            $arr=array('result'=>"ture");
				echo json_encode($arr);
        } else {
            $arr=array('result'=>"false");
				echo json_encode($arr);
        }
        




}
}